package cmpe.swe.purcom.dao.extractor;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

import cmpe.swe.purcom.model.Event;

public class EventResultSetExtractor implements ResultSetExtractor<Event> {

	@Override
	public Event extractData(ResultSet rs) throws SQLException,
			DataAccessException {
		Event e = new Event();
		e.setId(rs.getLong(1));
		e.setName(rs.getString(2));
		e.setDescription(rs.getString(3));
		e.setDatetime(rs.getTimestamp(4));
		e.setLocation(rs.getString(5));
		e.setCommunityid(rs.getLong(6));
		return e;
	}

}
